#ifndef __MODULE_H
#define __MODULE_H

#define MODULE_PRIO_IGNORE 64
#define MODULE_STAT_READY 0
#define MODULE_STAT_FINISH (1<<8)






typedef struct task_operate_s S_TASK_OPERATE, *PS_TASK_OPERATE;

typedef struct module_s
{
	char module_name[20];
	int module_prio;
	int module_stat;
	void *priv;
	PS_PROP_LIST pstConf_gui;
	struct task_operate_s *pstOperate;
	ELEMENT_PS pstConf_unit;
	struct module_s *pnext;
}S_MODULE, *PS_MODULE;

typedef int (*TASK_INIT)(PS_MODULE self);
typedef int (*TASK_DEAL)(PS_MODULE self);
typedef int (*TASK_END)(PS_MODULE self);
typedef int (*TASK_DEAL_ERR)(PS_MODULE self);

struct task_operate_s
{
	TASK_INIT task_init;
	TASK_DEAL task_deal;
	TASK_END task_end;
	TASK_DEAL_ERR task_err;
};


PS_MODULE module_create(char *name, int prio);
int module_register_gui(PS_MODULE self, DLGTEMPLATE *pstDlg, CTRLDATA *pstCtr, int cnt, WNDPROC proc);
int module_register_configure(PS_MODULE self, MOMAP_PS pstMap, int cnt);
int local_register_gui(DLGTEMPLATE *pstDlg, CTRLDATA *pstCtr, int cnt, WNDPROC proc);
int module_install_oper(PS_MODULE self, PS_TASK_OPERATE pstOper);
void *module_schedul(void *ptr);





#endif
